
<?php
	session_start();
	if(!isset($_SESSION['user'])||$_SESSION['pos']!="Regular")
	{
		header("Location: index.php");
	}
	require_once("startedContractsController.php");
	$viewstart = new startedContractsController;
	$empnum = $_SESSION['user'];
	$result = $viewstart->sendViewStartedContractsRequest($empnum);
	
	if((mysql_num_rows($result)*300)+200 > 800 )
		$height = (mysql_num_rows($result)*300)+200;
	else
		$height = 800;
$result = $viewstart->sendViewStartedContractsRequest($empnum);
?>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">
<html>
<head>
<title>APO Cooperative Database System - Home</title>
<meta http-equiv="content-type" content="text/html; charset=iso-8859-1">
<link rel="stylesheet" type="text/css" href="style.css" />
<link rel="stylesheet" type="text/css" href="css/ui-lightness/jquery-ui-1.8rc2.custom.css" />
<script type="text/javascript">
function finalize(fullname)
{
	return confirm("Are you sure you want to delete " + fullname + "?");
}
</script>
</head>
<<<<<<< .mine
=======
<body>
<div class="container ui-corner-all"  style="height:<?php echo (mysql_num_rows($result)*300)+200 ?>px">
	<div class="header ui-corner-top">
  <h1>APO Cooperative Database System</h1>
</div>
<div class="divider"></div>
  <div class="wrapper">
    <div class="content">

>>>>>>> .r35
<<<<<<< .mine
<div class="container ui-corner-all"  style="height:<?php $height ?>px">
	<div class="header ui-corner-top">
  <h1>APO Cooperative Database System</h1>
</div>
<div class="divider"></div>
  <div class="wrapper">
    <div class="content">
		<?php
		if($result!=false && mysql_num_rows($result)!=0)
		{
			while($row = mysql_fetch_array($result))
			{
				echo 
					"
					<table class=\"data\">
						<tr>
							<th>Name</th>
							<td>".$row['Last_name'].", ".$row['First_name']." ".$row['Middle_name']."</td>
						</tr>
						<tr>
							<th>Policy Number</th>
							<td>".$row['Policy_no']."</td>
						</tr>
						<tr>
							<th>Application Number</th>
							<td>".$row['Application_no']."</td>
						</tr>
						<tr>
							<th>Effective Date</th>
							<td>".$row['Effective_date']."</td>
						</tr>
						<tr>
							<th>Due Date</th>
							<td>".$row['Due_date']."</td>
						</tr>
						<tr>
							<th>Account Executive</th>
							<td>".$row['Account_executive']."</td>
						</tr>
						<tr>
							<th>Branch</th>
							<td>".$row['Branch']."</td>
						</tr>
						<tr>
							<th>Mode of Payment</th>
							<td>".$row['Mode_of_payment']."</td>
						</tr>
						<tr>
							<th>Type of Plan</th>
							<td>".$row['Type_of_plan']."</td>
						</tr>
						<tr>
							<th>Plan Value</th>
							<td>".$row['Plan_value']."</td>
						</tr>
						<tr>
							<th>Term</th>
							<td>".$row['Term']."</td>
						</tr>
						<tr>
							<th>Birthday</th>
							<td>".$row['Bday']."</td>
						</tr>
						<tr>
							<th>Age</th>
							<td>".$row['Age']."</td>
						</tr>
						<td>
						<form action=\"\" method=\"post\">
							<input type=\"hidden\" name=\"Policy_no\" value=\"".$row['Policy_no']."\" />
							<input type=\"submit\" value=\"Edit\" />
						</form>
						<form action=\"deletePlanholderController.php\" method=\"post\">
							<input type=\"hidden\" name=\"Policy_no\" value=\"".$row['Policy_no']."\" />
							<input type=\"submit\" value=\"Delete\" />
						</form>
						</td>
						</tr>
						</table>
						<hr/>
				";
			}
		}
		else
		{
			echo "No Planholders";
		}
		
		?>
		</div>
        </div>
  <div class="navigation ui-corner-all">
    <div class="navheader ui-corner-top"></div>
  	<div class="userstat">
		<?php
			echo "<p>You are logged in as: <br/>".$_SESSION['name']."<br/></p>";
			echo "<a href=\"\">Edit</a> your profile<br />";
			echo "<a href=\"logOut.php\">Log Out</a><br />";
		?>
    </div>
    </div>
    <div class="extra ui-corner-all">
    <div class="navheader ui-corner-top"></div>
    <div class="userstat">
    	<a href="employeepage.php">Back to profile page</a><br />
    	<a href="addPlanholderView.php">Add Planholders</a><br />
        <a href="viewStartedContractsView.php">View Started Contract</a><br />
    </div>
    </div>
    <div class="footer ui-corner-bottom">
    <a href="#">Contact Us</a> | <a href="#">Terms of Use</a> | <a href="#">Trademarks</a> | <a href="#">Privacy Statement</a><br />
    Copyright &copy; 2009 . All Rights Reserved.
  </div>
</div>
</body>
</html>
=======
<table>

<?php
>>>>>>> .r35

<<<<<<< .mine
=======


while($row = mysql_fetch_array($result))
{
	echo 
							"
					<table>
						<tr>
							<th>Name</th>
							<td>".$row['Last_name'].", ".$row['First_name']." ".$row['Middle_name']."</td>
						</tr>
						<tr>
							<th>Policy Number</th>
							<td>".$row['Policy_no']."</td>
						</tr>
						<tr>
							<th>Effective Date</th>
							<td>".$row['Effective_date']."</td>
						</tr>
						<tr>
							<th>Due Date</th>
							<td>".$row['Due_date']."</td>
						</tr>
						<tr>
							<th>Branch</th>
							<td>".$row['Branch']."</td>
						</tr>
						<tr>
							<th>Mode of Payment</th>
							<td>".$row['Mode_of_payment']."</td>
						</tr>
						<tr>
							<th>Type of Plan</th>
							<td>".$row['Type_of_plan']."</td>
						</tr>
						<tr>
							<th>Birthday</th>
							<td>".$row['Bday']."</td>
						</tr>
						<tr>
							<th>Age</th>
							<td>".$row['Age']."</td>
						</tr>
						<tr>
							<th>Account Executive</th>
							<td>".$row['Account_executive']."</td>
						</tr>
						
						";

			echo 
						"</td>
						</tr>
						<tr>
						<td>
						<form action=\"editPlanholderView.php\" method=\"post\">
							<input type=\"hidden\" name=\"full_name\" value=\"".$row['First_name']." ".$row['Last_name']."\" />
							<input type=\"hidden\" name=\"Policy_no\" value=\"".$row['Policy_no']."\" />
							<input type=\"submit\" value=\"Edit\" />
						</form>
						<form action=\"deletePlanholderController.php\" method=\"post\" onsubmit=\"return finalize(document.getElementById('full_name').value)\">
							<input type=\"hidden\" id=\"full_name\" value=\"".$row['First_name']." ".$row['Last_name']."\" />
							<input type=\"hidden\" name=\"Policy_no\" value=\"".$row['Policy_no']."\" />
							<input type=\"submit\" value=\"Delete\" />
						</form>
						</td>
						</tr>
						</table>
						<hr/>
				";
/*	echo 
	"</td>
	<td>
	<form action=\"editPlanholderView.php\" method=\"post\">
		<input type=\"hidden\" name=\"Policy_no\" value=\"".$row['Policy_no']."\" />
		<input type=\"submit\" value=\"Edit\" />
	</form>
	</td>
	<td>
	<form action=\"deletePlanholderController.php\" method=\"post\">
		<input type=\"hidden\" name=\"Policy_no\" value=\"".$row['Policy_no']."\" />
		<input type=\"submit\" value=\"Delete\" />
	</form>
	</td>
	</tr>
	";*/
}

?>
</table>
 </div></div>
  <div class="navigation ui-corner-all">
    <div class="navheader ui-corner-top"></div>
  	<div class="userstat">
    <?php
    	
			echo "<p>You are logged in as: <br/>".$_SESSION['name']."<br/></p>";
			echo "<a href=\"\">Edit</a> your profile<br />";
			echo "<a href=\"logOut.php\">Log Out</a><br />";
		
	?>
    </div>
    </div>
    <div class="extra ui-corner-all">
    <div class="navheader ui-corner-top"></div>
    <div class="userstat">
    	<a href="employeepage.php">Back to profile page</a><br />
    	<a href="addPlanholderView.php">Add Planholders</a><br />
        <a href="viewStartedContractsView.php">View Started Contract</a><br />
    </div>
    </div>
    <div class="footer ui-corner-bottom">
    <a href="#">Contact Us</a> | <a href="#">Terms of Use</a> | <a href="#">Trademarks</a> | <a href="#">Privacy Statement</a><br />
    Copyright &copy; 2009 . All Rights Reserved.
  </div>
</div>
</body>
</html>>>>>>>> .r35
